import { axios } from '@/utils/request'

/**
 * 客户(商圈)管理
 */
export function selectAllCustomer () {
  return axios({
    url: '/shop/customer/selectAllCustomer',
    method: 'post'
  })
}

export function selectPage (parameter) {
  return axios({
    url: '/mini/customer/list',
    method: 'get',
    params: parameter
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/mini/customer/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function del (parameter) {
  return axios({
    url: '/mini/customer/' + parameter,
    method: 'delete'
  })
}

export function refreshApi (parameter) {
  return axios({
    url: '/shop/customer/' + parameter + '/refreshApi',
    method: 'get'
  })
}

export function getUseableAmount (parameter) {
  return axios({
    url: '/shop/customer/' + parameter + '/getUseableAmount',
    method: 'get'
  })
}

export function createCustomerFlow (parameter) {
  return axios({
    url: '/shop/customer/createCustomerFlow',
    method: 'post',
    params: parameter
  })
}

export function selectGrids () {
  return axios({
    url: '/shop/customer/selectGrids',
    method: 'get'
  })
}
